﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DroneLib.Vehicles
{
    partial class Vehicle
    {
        public void Disconnect()
        {
            _MavStream.Close();
            _MavStream.Dispose();
            _MavStream = null;

            Vehicle v;
            _KnownVehicles.TryRemove(this.Guid, out v);

            VehicleDisconnected?.Invoke(this);
        }

        public bool Disposed { get; private set; } = false;
        public void Dispose()
        {
            Disposed = true;
        }
    }
}
